package com.hzhq.contract.convert.method;

import com.hzhq.contract.util.ConvertUtil;
import org.bson.types.ObjectId;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

/**
 * @Author: hzhq1255
 * @Mail: hzhq1255@163.com
 * @Date: 2021/5/10 1:51 上午
 * @Desc:
 */
@Component
public class StringToObjectIdConverter implements Converter<String, ObjectId> {

    @Override
    public ObjectId convert(String s) {
        return ConvertUtil.stringToObjectId(s);
    }
}
